package com.springmvc.controller;

import com.springmvc.service.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2018/12/9 21:19
 */
@Controller
public class HelloController {

    @Autowired
    private HelloService helloService;

    @ResponseBody
    @RequestMapping("/hello")
    public String hello() {
        String result = helloService.sayHello("tomcat");
        System.out.println("success");
        return result;
    }

    @RequestMapping("/success")
    public String success() {
        return "success";
    }
}
